// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
// let hotSearchUrl = '/ebapi/store_api/hot_search';
// let indexUrl = '/api/index';   //API数量多的话，就不写这里了

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	
	//定义api属性
	vm.$u.api = {}
	
	/* 个人中心 */
	//微信登录
	vm.$u.api.wxLogin = params => vm.$u.post('/api/user/wxLogin', params)
	//用户是否存在
	vm.$u.api.wxUserSelectOne = params => vm.$u.post('/api/user/wxUserSelectOne', params)
	//微信退出
	vm.$u.api.wxLogout = params => vm.$u.post('/api/user/wxLogout', params)
	//用户详情
	vm.$u.api.userInfo = params => vm.$u.post('/api/user/userInfo', params)
	//我的收藏
	vm.$u.api.collectionMy = params => vm.$u.post('/api/collection/collectionMy', params)
	//删除收藏
	vm.$u.api.collectionDelete = params => vm.$u.post('/api/collection/collectionDelete', params)
	//学历列表
	vm.$u.api.getEducationBackgroundList = params => vm.$u.post('/api/educationBackground/educationBackgroundSelectView', params)
	
	/* 找校友 */
	//全局搜索
	vm.$u.api.userSelect = params => vm.$u.get('/api/user/userSelect', params)
	//条件查询
	vm.$u.api.userSelectBy = params => vm.$u.post('/api/user/userSelectBy', params)
	//行业列表
	vm.$u.api.getOccupationalList = params => vm.$u.post('/api/occupational/occupationalSelectView', params)
	//人脸识别
	vm.$u.api.faceSearch = params => vm.$u.post('/api/face/faceSearch', params)
	//个人信息编辑
	
	
	/* 互助*/
	//条件查询
	vm.$u.api.helpSelectBy = params => vm.$u.post('/api/help/helpSelectBy', params)
	//最热
	vm.$u.api.helpSortBySupport = () => vm.$u.get('/api/help/helpSortBySupport')
	//发布互助
	vm.$u.api.helpAdd = params => vm.$u.post('/api/help/helpAdd', params)
	// //互助详情
	// vm.$u.api.helpInfoById = params => vm.$u.post('/api/help/helpInfoById', params)
	//互助点赞
	vm.$u.api.helpLike = params => vm.$u.post('/api/help/helpLike', params)
	//互助收藏
	vm.$u.api.helpCollection = params => vm.$u.post('/api/help/helpCollection', params)
	//互助删除
	vm.$u.api.helpDeleteByIds = params => vm.$u.post('/api/help/helpDeleteByIds', params)
	//互助编辑
	vm.$u.api.helpUpdate = params => vm.$u.post('/api/help/helpUpdate', params)
	
	/* 活动 */
	//条件查询
	vm.$u.api.activitySelectBy = params => vm.$u.post('/api/activity/activitySelectBy', params)
	//头部导航栏 最新最热等
	vm.$u.api.activitySelect = (params) => vm.$u.post('/api/activity/activitySelect', params)
	//发布活动
	vm.$u.api.activityAdd = params => vm.$u.post('/api/activity/activityAdd', params)
	// //活动详情
	// vm.$u.api.activityInfoById = params => vm.$u.post('/api/activity/activityInfoById', params)
	//活动点赞
	vm.$u.api.activityLike = (params) => vm.$u.post('/api/activity/activityLike', params)
	//活动收藏
	vm.$u.api.activityCollection = (params) => vm.$u.post('/api/activity/activityCollection', params)
	//活动删除
	vm.$u.api.activityDeleteByIds = (params) => vm.$u.post('/api/activity/activityDeleteByIds', params)
	//活动编辑
	vm.$u.api.activityUpdate = (params) => vm.$u.post('/api/activity/activityUpdate', params)
	//报名用户
	vm.$u.api.applyUsers = (params) => vm.$u.post('/api/apply/applyUsers', params)
	//活动报名
	vm.$u.api.applyAdd = (params) => vm.$u.post('/api/apply/applyAdd', params)
	//取消报名
	vm.$u.api.applyDelete = (params) => vm.$u.post('/api/apply/applyDelete', params)
	//我报名的活动
	vm.$u.api.applyActivityList = (params) => vm.$u.post('/api/apply/applyActivityList', params)
	
	
	/* 相册 */
	//条件查询
	vm.$u.api.albumSelectBy = params => vm.$u.post('/api/album/albumSelectBy', params)
	//头部导航栏 最新0、最热1、评论2、全部3
	vm.$u.api.albumSelect = (params) => vm.$u.post('/api/album/albumSelect', params)
	//发布相册
	vm.$u.api.albumAdd = params => vm.$u.post('/api/album/albumAdd', params)
	// //相册详情
	// vm.$u.api.albumInfoById = params => vm.$u.post('/api/album/albumInfoById', params)
	//相册点赞
	vm.$u.api.albumLike = params => vm.$u.post('/api/album/albumLike', params)
	//相册收藏
	vm.$u.api.albumCollection = params => vm.$u.post('/api/album/albumCollection', params)
	//相册删除
	vm.$u.api.albumDeleteByIds = params => vm.$u.post('/api/album/albumDeleteByIds', params)
	//相册编辑
	vm.$u.api.albumUpdate = params => vm.$u.post('/api/album/albumUpdate', params)
	
	/* 资讯 */
	//条件查询
	vm.$u.api.newsSelectBy = params => vm.$u.post('/api/news/newsSelectBy', params)
	//头部导航栏 最新最热等
	vm.$u.api.newsSelect = (params) => vm.$u.post('/api/news/newsSelect', params)
	// //资讯详情
	// vm.$u.api.newsInfoById = params => vm.$u.post('/api/news/newsInfoById', params)
	//资讯点赞
	vm.$u.api.newsLike = params => vm.$u.post('/api/news/newsLike', params)
	//资讯收藏
	vm.$u.api.newsCollection = params => vm.$u.post('/api/news/newsCollection', params)
	
	/* 评论 */
	//查询详情页面 评论
	vm.$u.api.commentSelect = (params) => vm.$u.post('/api/comment/commentSelect', params)
	//评论
	vm.$u.api.commentToAdd = (params) => vm.$u.post('/api/comment/commentToAdd', params)
	//删除评论
	vm.$u.api.commentToDeleteByIds = (params) => vm.$u.post('/api/comment/commentToDeleteByIds', params)
	//回复评论
	vm.$u.api.replyAdd = (params) => vm.$u.post('/api/comment/replyAdd', params)
	//删除回复评论
	vm.$u.api.replyDeleteByIds = (params) => vm.$u.post('/api/comment/replyDeleteByIds', params)
	
	/* 七牛云删除图片 */
	vm.$u.api.deleteImg = (params) => vm.$u.post('/api/photo/deleteImg', params)
	/* 类别列表 */
	vm.$u.api.getClassificationList = (params) => vm.$u.post('/api/classification/classificationSelectView', params)
	
	// 将各个定义的接口名称，统一放进对象挂载到vm.$u.api(因为vm就是this，也即this.$u.api)下
	// vm.$u.api = {
	// 	index,
	// 	authLogin
	// };
}

export default {
	install
}